import { findAllUserApi } from "../apis/userApi"
import { useDispatch } from "react-redux"
import {initUserAC} from "../redux/actions/accountAction"
const useRequest = () => {
    const dispatch = useDispatch()
    //发送请求
    const getUsers = async () => {
        const res = await findAllUserApi()
        //负责将得到数据更新到redux中
        dispatch(initUserAC(res.data.data))
    }
    const deleteUser = (id) => {

    }
    return {getUsers,deleteUser}

}
export default useRequest
